class String
  def shorten(ln)
    return if self.length <= ln
    self[0..(ln - 3)] + "..."
  end
  
  def capitalize_each_word
    self.split(' ').collect{|part| part.capitalize << " "}.to_s.strip
  end
end

class Date
  def mmddyyyy
    strftime("%m/%d/%Y")
  end

  def day_month_year
    strftime("%b %d, %Y")
  end
end

class NilClass
  def exists?
    false
  end
end

class Object
  def exists?
    true
  end
end
